package com.mnsq.common.bean.entity;

import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;

/**
 * 浏览记录
 *
 * @author 周俭
 */
@Data
@Accessors(chain = true)
@Entity
@Table(name = "view_log", indexes = {@Index(name = "idx_search", columnList = "", unique = true)})
public class ViewLog extends CommonEntity {
    private static final long serialVersionUID = -3662878852935789835L;

    @Column(name = "target_unique", columnDefinition = "varchar(64) not null comment '目标对象主键id'")
    private String targetUnique;

    /**
     * @see com.mnsq.common.bean.enums.SubjectType
     */
    @Column(name = "target_type", columnDefinition = "int(2) not null comment '目标对象类型'")
    private Integer targetType;

    @Column(name = "title", columnDefinition = "varchar(200) not null comment '内容标题（冗余字段）'")
    private String title;
}
